﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/AdminMasterPage.master" CodeBehind="Insert.aspx.cs"
    Inherits="RMS.Admin.Insert" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PagContent" runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
        <DataControls>
            <asp:DataControlReference ControlID="FormView1" />
        </DataControls>
    </asp:DynamicDataManager>
    <table id="detailsTable" class="Details" cellpadding="0" cellspacing="0">
        <tr>
            <td class="header" colspan="2">
                Add new entry to table
                <%= table.DisplayName %>
            </td>
        </tr>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="FormView1"
                    Display="None" CssClass="DDValidator" />
                <asp:FormView runat="server" ID="FormView1" DataSourceID="DetailsDataSource" DefaultMode="Insert"
                    OnItemCommand="FormView1_ItemCommand" OnItemInserted="FormView1_ItemInserted"
                    RenderOuterTable="false">
                    <InsertItemTemplate>
                        <asp:DynamicEntity runat="server" Mode="Insert" />
                        <tr class="td">
                            <td colspan="2">
                                <asp:LinkButton runat="server" CommandName="Insert" Text="Insert" />
                                <asp:LinkButton runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="false" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="footer">
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true" />
                            </td>
                        </tr>
                    </InsertItemTemplate>
                </asp:FormView>
                <asp:LinqDataSource ID="DetailsDataSource" runat="server" EnableInsert="true" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </table>
</asp:Content>
